package com.yue.mock.service;

import com.yue.mock.bean.Person;
import com.yue.mock.dao.PersonDao;

/**
 * 功能描述: TODO <br/>
 * 创建时间: 2016/11/15<br/>
 *
 * @author QiuYang
 */
public class PersonService {
    private PersonDao personDao;

    public PersonService(PersonDao personDao) {
        this.personDao = personDao;
    }

    public boolean update(Integer personId, String name){
        Person person = personDao.fetchPerson(personId);
        if (null != person){
            Person updatePerson = new Person(person.getPersonId(), name);
            personDao.update(updatePerson);
            return true;
        }
        return false;
    }
}
